public class Swapper
{
   /**
      This method swaps adjacent elements of the given array
      @param values an array
   */
   public void swapAdjacentElements(int[] values)
   {
      // your work here
      int t;
      int len=values.length;
      if(len%2==1){
         for(int i=0;i<len-1;i+=2){
            t=values[i];
            values[i]=values[i+1];
            values[i+1]=t;
         }
      }else{
         for(int i=0;i<len;i+=2){
            t=values[i];
            values[i]=values[i+1];
            values[i+1]=t;
         }
      }
   }
   
   
   // This method is used to check your work
   public int[] check(int[] values)
   {
      swapAdjacentElements(values);
      return values;
   }
}